<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
        
    <script type="text/javascript">
    <!-- 
    $(document).ready(function() {
    
    	$('#doChangePwdBtn').click(function() {
			var errMsg = "";
			var currentPwd = $('#currentPwd').val();
			var newPwd = $('#newPwd').val();
			var confirmPwd = $('#confirmPwd').val();			
			
			if (null == currentPwd || 0 == currentPwd.length){
				errMsg = errMsg + "目前密碼 是必要欄位<br/>";
			}
			
			if (null == newPwd || 0 == newPwd.length){
				errMsg = errMsg + "新密碼 是必要欄位<br/>";
			}
			
			if (null == confirmPwd || 0 == confirmPwd.length){
				errMsg = errMsg + "確認新密碼 是必要欄位<br/>";
			}
			
			if (newPwd != confirmPwd){
				errMsg = errMsg + "新密碼 與 確認新密碼 不符<br/>";
			}
			
			if (0 != errMsg.length){
				showErrorMessageDialog(errMsg);
				
				return false;
			}
			
			return true;
		});
        	
    	<c:if test="${not empty actionBean.errorMessage}">
    	showErrorMessageDialog('<c:out value="${actionBean.errorMessage }" escapeXml="false"/>');
    	</c:if>
    	
    	<c:if test="${not empty actionBean.message}">
    	showMessageDialog('<c:out value="${actionBean.message }" escapeXml="false"/>');
    	</c:if>
    	
    	
    });
    	
    
    //-->
    </script>
</head>
<body>
	
	<div id="smallQueryForm"></div>
	
<stripes:form id="changePwdFrom" beanclass="com.feib.stms.action.Stms9001ActionBean" method="post" onsubmit="javascript: waitingDialog({});">

	<div id="queryForm">
		<table>
			<tr>
				<td colspan="5" class="queryHeader">登入密碼修改</td>
			</tr>
			<tr>
				<th>業者代號</th>
				<td colspan="4"><c:out value="${actionBean.user.group.groupNo }"/></td>
			</tr>
			<tr>
				<th>登入帳號</th>
				<td colspan="4"><c:out value="${actionBean.user.userId }"/></td>
			</tr>
			<tr>
				<th>目前密碼<span id="mustKeyInStar">**</span></th>
				<td colspan="4"><stripes:password id="currentPwd" name="currentPwd" size="20" maxlength="20"/></td>
			</tr>
			<tr>
				<th>新密碼<span id="mustKeyInStar">**</span></th>
				<td colspan="4"><stripes:password id="newPwd" name="newPwd" size="20" maxlength="20"/></td>
			</tr>
			<tr>
				<th>確認新密碼<span id="mustKeyInStar">**</span></th>
				<td colspan="4"><stripes:password id="confirmPwd" name="confirmPwd" size="20" maxlength="20"/></td>
			</tr>
			<tr>
				<td colspan="5" class="queryFunction"><stripes:submit id="doChangePwdBtn" name="doChangePwd" value="變更密碼" class="formBtn"/></td>
			</tr>
		</table>
	</div>
</stripes:form>
	
	<div id="listForm"></div>

</body>
</html>
